package com.eagle.depthinspringboot.configuration.bootstrapt;

import com.eagle.depthinspringboot.configuration.repository.MyFirstLevelRepository;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * 仓储的引导类
 *
 * @author 小马哥
 * @since 2018/5/14
 */
@ComponentScan(basePackages = "com.eagle.depthinspringboot.configuration.repository")
public class RepositoryBootstrap {
	public static void main(String[] args) {
		ConfigurableApplicationContext ctx =
				new SpringApplicationBuilder(RepositoryBootstrap.class)
						.web(WebApplicationType.NONE)
						.run(args);
		MyFirstLevelRepository myFirstLevelRepository = ctx.getBean("myFirstLevelRepository",
				MyFirstLevelRepository.class);
		System.out.println("myFirstLevelRepository bean: "+myFirstLevelRepository);
	}

}
